Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: IUnitOfWork injection #52

Merged
merged 3 commits into from
Oct 7, 2024
Merged

Conversation

mvarendorff2
Copy link
Member

This PR fixes injection of the IUnitOfWork parameter for HotChocolate resolvers.

  • Limit parameter resolution to IUnitOfWork because .WithPrefilledVersion returns an IUnitOfWork
  • Mark the expression builder as not pure for two reasons:
    • It isn't: Building a unit of work writes to a global state
    • Marking the builder as pure causes HC to sometimes inject an IPureResolverContext, breaking the expression which requires an IResolverContext and not a pure one

Copy link

codecov bot commented Oct 4, 2024

Codecov Report

Attention: Patch coverage is 15.38462% with 11 lines in your changes missing coverage. Please review.

Project coverage is 80.61%. Comparing base (c2313ab) to head (682ea5d).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...tChocolate/UnitOfWorkParameterExpressionBuilder.cs 20.00% 8 Missing ⚠️
src/Fluss.HotChocolate/AddExtensionMiddleware.cs 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #52      +/-   ##
==========================================
+ Coverage   80.59%   80.61%   +0.02%     
==========================================
  Files          83       83              
  Lines        3720     3725       +5     
  Branches      376      375       -1     
==========================================
+ Hits         2998     3003       +5     
  Misses        648      648              
  Partials       74       74              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mvarendorff2 mvarendorff2 marked this pull request as draft October 4, 2024 09:22
@mvarendorff2 mvarendorff2 marked this pull request as ready for review October 4, 2024 09:34
@Enterprize1 Enterprize1 force-pushed the fix/i-unit-of-work-injection branch from 7cd6d0c to a607fd7 Compare October 6, 2024 10:03
@mvarendorff2 mvarendorff2 force-pushed the fix/i-unit-of-work-injection branch from a607fd7 to 682ea5d Compare October 7, 2024 11:36
@mvarendorff2 mvarendorff2 merged commit b57d2f7 into main Oct 7, 2024
6 of 7 checks passed
@mvarendorff2 mvarendorff2 deleted the fix/i-unit-of-work-injection branch October 7, 2024 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant